package com.itany.corejava.day03;

public class Test6 {

    public static void main(String[] args) {

        double sum=0;
        int f=1;
        for (double i=1;i<=20;i++){

            double temp=(i+(2.0*i-1)/(i*i))*f;

            sum+=temp;

            f=-f;

        }

        System.out.println("sum = " + sum);

    }
}
